package com.health.ai.controller;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;

@RestController
@RequestMapping("ds")
public class OpenaiController {

//    private final ChatClient chatClient;
//
//    public OpenaiController(ChatClient.Builder chatClientBuilder) {
//        this.chatClient = chatClientBuilder.build();
//    }
//
//    @GetMapping(value = "/ai/generateStreamAsString", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
//    public Flux<String> generateStreamAsString(@RequestParam(value = "message", defaultValue = "讲个笑话") String message) {
//        //Prompt prompt = new Prompt(new UserMessage(message));
//        //return chatClient.stream(prompt);
//        Flux<String> content = chatClient.prompt()
//                .user(message)
//                .stream()
//                .content();
//
//        return  content;
//
//    }
}
